#DEFINES += AS_PLUGIN

CONFIG(debug, debug|release) {
SOURCES += \
        main.cpp
TARGET = ukui-tablet-desktop
} else {
if (contains(DEFINES, AS_PLUGIN)) {
    message("ukui-tablet-desktop is a plugin")
    TEMPLATE = lib
    TARGET = ukui-tablet-desktop-plugin
    CONFIG += plugin
} else {
    message("ukui-tablet-desktop is a app")
    TARGET = ukui-tablet-desktop
    TEMPLATE = app
    SOURCES += \
            main.cpp
}
}

QT += widgets quick quickcontrols2
CONFIG += c++11

#QMAKE_CXXFLAGS += -g

include($$PWD/kgridview/kgridview.pri)
include($$PWD/src.pri)

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

qml.files = $$files(ui/qml/*)
qml.prefix =

RESOURCES += qml

images.files += $$files(ui/images/*.svg) \
        $$files(ui/images/categories/*.svg) \
        $$files(ui/images/*.png)
images.prefix =
RESOURCES += images

qmldir.files = ui/qml/qmldir
RESOURCES += qmldir

qmldir_plugin.files = qmldir
RESOURCES += qmldir_plugin

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =

TRANSLATIONS += \
    translations/ukui-tablet-desktop_zh_CN.ts

# Default rules for deployment.
desktopFile.files = $$PWD/../data/ukui-tablet-desktop.desktop
desktopFile.path = /etc/xdg/autostart

pluginFile.files = $$PWD/../ukui-tablet-desktop/libukui-tablet-desktop-plugin.so

qml.path = /usr/share/ukui/tablet/contents/ui
qmldir.path = /usr/share/ukui/tablet/contents/ui

target.path = /usr/bin

qm_files.files = translations/ukui-tablet-desktop_zh_CN.qm
qm_files.path = /usr/share/ukui/translations/ukui-tablet-desktop

if (contains(DEFINES, AS_PLUGIN)) {
    uri = org.ukui.tablet
    installPath = $$[QT_INSTALL_QML]/$$replace(uri, \., /)
    qmldir_plugin.path = $$installPath
    target.path = $$installPath
    INSTALLS += qmldir_plugin qml qmldir
}
INSTALLS += target desktopFile qm_files

LIBS += -lukui-log4qt

DBUS_INTERFACES += dbusinterfaces/com.kylin.AppManager.xml

!system($$PWD/../translate_generation.sh): error("Failed to generate translation")

